<template>
	<view class="e-p-30" :style="[AppSkinVar]">
		<view class="ql-container ql-snow">
			<view class="ql-editor">
				<rich-text :nodes="content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
import { computed, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { useBasics } from '@/common/stores';
import { richTextFilter } from '@/common/utils';

const props = defineProps({
	id: String
});

const basicsStore = useBasics();
const { agreement } = storeToRefs(basicsStore);

basicsStore.getBasicsSetting();

const agreementItem = computed(() => agreement.value?.find?.((item) => item.id === Number(props.id)));
const content = computed(() => richTextFilter(agreementItem.value?.content));

watch(
	agreementItem,
	(v) => {
		if (v) {
			uni.setNavigationBarTitle({
				title: v.remark
			});
		}
	},
	{
		immediate: true
	}
);
</script>
<style>
page {
	background-color: #fff;
}
</style>
<style lang="scss" scoped></style>
